#include <iostream>

using namespace std;

void test_function_signature();

void print(int a, int b); // 1
void print(double a, double b); // 2
void print(int a, int b, int c); // 3
//void print(int x, int y); // redeclaration of 'void print(int, int)' no error but redefinition of 'void print(int, int)' will cause error.
int print(int a, int b);//example1.cpp:11:5: error: ambiguating new declaration of 'int print(int, int)'

int main(int argc, char const *argv[])
{
    test_function_signature();
    return 0;
}

void test_function_signature()
{
    int a = 10;
    int b = 20;
    int c = 30;

    double m = 5.1;
    double n = 5.2;

    print(a, b); // use 1
    print(a, b, c); // use 3
    print(m, n); //use 2
}

void print(int a, int b)
{
    cout << a << ", " << b << endl;
}


void print(double a, double b)
{
    cout << a << ", " << b << endl;
}


void print(int a, int b, int c)
{
    cout << a << ", " << b << ", " << c << endl;
}

/*
example1.cpp:49:6: error: redefinition of 'void print(int, int)'
 void print(int x, int y)

void print(int x, int y)
{
     cout << x << ", " << y << endl;
}
*/

/*
error: ambiguating new declaration of 'int print(int, int)'
int print(int a, int b)
{
    cout << a << ", " << b << endl;
    return 0;
}
*/
